<template>
    <el-dialog title="选择登录科室" style="text-align: center;" :props="$props" :visible.sync="depart" width="36%"
               :close-on-click-modal="department.modal" :show-close="department.showClose">
        <ul role="menu" class="el-menu--popup-bottom-start">
            <li role="menuitem" class="el-menu-item" @click="onDepartPush(data)"
                style="border-top:1px solid #d9d1d1;font-size: 21px" v-for="(data,index) in departData" :index="index">
                {{data.deptName}}
            </li>
        </ul>
    </el-dialog>
</template>

<script>
    // import httpclient from 'httpclient';
    export default {
        props: {
            depart: {
                type: Boolean
            },
            departData: {
                type: Array,
                default() {
                    return this.$store.getters.routeStore["departList"];
                }
            }
        },
        data: function () {
            return {
                department: {
                    showClose: false,
                    modal: false
                }
            };
        },
        methods: {
            onDepartPush(data) {
                this.$store.commit('setTabOptions', []);
                this.$store.commit('setActiveIndex', '');
                this.$store.commit("setDepart", data);
                this.$router.push({name: 'index',query:{_k:randomString(7)}});
            },
        }
    };
</script>

